import { defineStore } from "pinia";
import { ref } from "vue";

export const counterStore = defineStore('counter',()=>{
    // 响应式数据
    const count = ref(0) // 声明一个响应式数据
    // 写函数(逻辑)-多少个都行
    const addCount = ()=>{
        count.value++
    }
    const cutCount = ()=>{
        count.value--
    }
    return {count, addCount, cutCount}
},{persist:true})